package com.dabai.iot.core.utils;

import com.alibaba.fastjson2.JSONObject;
import com.dabai.iot.core.entity.DeviceEntity;

/**
 * 告警输出工具类
 *
 * @author kev1n
 */
public class AlarmActionUtil {

    public static void httpPost(String url, DeviceEntity device, String alarmDescription) {
        JSONObject body = new JSONObject();
        body.put("deviceId", device.getId());
        body.put("deviceName", device.getDeviceName());
        body.put("description", alarmDescription);

        // TODO: 请自己实现
        // HttpUtil.post(url, body, 5000);
    }

    public static void qyWechatPost(String url, DeviceEntity device, String alarmDescription) {
        JSONObject textJson = new JSONObject();
        textJson.put("content", alarmDescription);

        JSONObject body = new JSONObject();
        body.put("msgtype", "text");
        body.put("text", textJson);

        // TODO: 请自己实现
        // HttpUtil.post(url, body, 5000);
    }

}
